<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>SVG基础</title>
    <style>
      * {
        padding: 0;
        margin: 0;
      }

      #root {
        width: 200px;
      }

      #item {
        margin-bottom: 10px;
        border: 1px solid #ccc;
      }

      .rect {
        animation: rotate1 1.4s linear infinite;
      }

      @keyframes rotate1 {
        0% {
          transform: rotate(0deg);
          transform-origin: center;
          /* transform-origin: 50%; */
        }
        25% {
          transform: rotate(90deg);
          transform-origin: center;
          /* transform-origin: 50%; */
        }
        50% {
          transform: rotate(180deg);
          transform-origin: center;
          /* transform-origin: 50%; */
        }
        75% {
          transform: rotate(270deg);
          transform-origin: center;
          /* transform-origin: 50%; */
        }
        100% {
          transform: rotate(360deg);
          transform-origin: center;
          /* transform-origin: 50%; */
        }
      }
    </style>
  </head>
  <body>
    <div id="root">
      <div id="item">
        <!-- viewBox="-100 -100 200 200" -->
        <svg width="200" height="200" viewBox="-100 -100 200 200">
          <rect
            class="rect"
            x="0"
            y="0"
            width="100"
            height="100"
            fill="grey"
            stroke="red"
            stroke-width="1"
          />
        </svg>
      </div>
    </div>
  </body>
</html>
